package com.hzdl.apple.dao.imp.back;

import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.dbutils.handlers.BeanHandler;

import com.hzdl.apple.bean.Admin;
import com.hzdl.apple.dao.BaseDaoImp;
import com.hzdl.apple.dao.back.AdminDao;

public class AdminDaoImp extends BaseDaoImp implements AdminDao {
	
	@Override
	public Admin getAdminByLogin(Admin admin, Connection conn) {
		sql = "select * from admin where ALoginId = ? and APsw = ?";
		Admin admin1 = null;
		try {
			admin1 = qr.query(sql, new BeanHandler<>(Admin.class),admin.getALoginId(),admin.getAPsw());
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return admin1;
	}

}
